package com.seas.dao;

import com.seas.domain.People;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

/**
 * Created by Seas Cheng on 2017/9/29
 */
public interface PeopleRepository extends MongoRepository<People, String>{

    People findByName(String name);
    List<People> findAllByName(String name);

    @Query("{'age':?0}")
    List<People> withQueryFindByAge(Integer age);
}
